At one high loaded web project I needed a very fast file system. I decided to use Ext4 with disabled journal (As a google:))).
# Create ext4 fs on /dev/sda10 disk
mkfs.ext4 /dev/sda10
# Enable writeback mode. This mode will typically provide the best ext4 performance.
tune2fs -o journal_data_writeback /dev/sda10
# Delete has_journal option
tune2fs -O ^has_journal /dev/sda10
# Required fsck
e2fsck -f /dev/sda10
# Check fs options
dumpe2fs /dev/sda10 |more
For more performance add fstab opions: data=writeback,noatime,nodiratime
i.e:
/dev/sda10 /opt ext4 defaults,data=writeback,noatime,nodiratime 0 0
Tested at non-boot partition ;)
Thursday, March 18, 2010
Subscribe to:
Post Comments (Atom)
are you really sure that this disables journaling?
ReplyDeleteas far i know journal_data_writeback is just another journal mode which creates journal of meta data only,...
# Delete has_journal option
ReplyDeletetune2fs -O ^has_journal /dev/sda10
This step disables journal
Or when creating
ReplyDeletemkfs.ext4 -O ^has_journal /dev/sda10
Would you be able to help with the following issue:
ReplyDeletegetting more r/w speed from a flash drive install
http://www.linuxquestions.org/questions/linux-general-1/getting-more-r-w-speed-from-a-flash-drive-install-827164/
Thanks in advance
Iain
Could you explain what the purpose of the journal_data_writeback option is once the journal is disabled with the ^has_journal?
ReplyDeleteit's needed to mount with data=writeback
DeleteI don't remember why I wrote this :)
ReplyDelete:)
DeleteOh wow thank for this bit of advice, I am now able to use ZFS on Linux with ext4 instead of ext2. The journaling feature of ext3-4 made ZFS snapshots work incorrectly. Now it works woo hoo!.
ReplyDeletehow to check the journal is enable or disable ?
ReplyDeletedumpe2fs /dev/sda4 |grep 'Filesystem features'
ReplyDeleteif has_journal option exist - you have journal
Thanks a lot ..................
ReplyDeleteI ended up here looking for the right command to remove journaling and thought this thread started some time ago, advice is still very good. My 2c for this are: add "discard" to the mount options in fstab
ReplyDelete/dev/sda10 /opt ext4 defaults,data=writeback,discard,noatime,nodiratime 0 0
"discard" will enable trimming (see http://sites.google.com/site/lightrush/random-1/howtoconfigureext4toenabletrimforssdsonubuntu)
Have a good one!
Marcos Albe
trimming is for newer ssd only (some older ssd not support trim), and not for traditional hdd.
DeleteThe above HowTo has been deprecated by the author.
DeleteThe above HowTo has been deprecated by the author.
DeleteThanks for posting this. Really helped our BigCouch cluster partitions. Couch is such a IO hog.
ReplyDeleteIn the end of the text, for fstab, "nodiratime" is not necessary, as noatime already includes that option. This can be seen in http://lwn.net/Articles/244941/, http://lwn.net/Articles/245002/, and other texts.
ReplyDeleteRoberto
Discard options is default in ext4
ReplyDeleteTejas
Adding discard is a terrible choice if your goal is performance. It is also meaningless for non-flash drives. If you have a flash drive, and performance is the goal, schedule a nightly fstrim cron job on the relevant partitions.
ReplyDeletenoatime already includes nodiratime, You don't need to specify both.
ReplyDeletehttps://wiki.archlinux.org/index.php/fstab#atime_options
noatime automatically enables nodiratime
ReplyDeletesuperb one. i used this technique for porteus linux.
ReplyDeleteадениус магазинсемян адениума,
ReplyDeleteadenium-obesum бонсай дома.